<meta charset="UTF-8">
<div style="display: none;">
	<!-- 登录框 -->
	<div id="loginPop" class="popup" style="height: 240px;">
		<form id="loginForm">
			<input type="text" id="email" name="email" tabindex="1"
				placeholder="请输入登录邮箱地址" style="padding: 0px;" /> <input
				type="password" id="password" name="password" tabindex="2"
				placeholder="请输入密码" /> <span class="error" style="display: none;"
				id="beError"></span> <a href="h/reset.html" class="fr">忘记密码？</a> <input
				type="submit" id="submitLogin" value="登 &nbsp; &nbsp; 录" />
		</form>
		<div>
			<div>还没有帐号？</div>
			<a href="register.html" class="registor_now">立即注册</a>
		</div>
	</div>
	<!--/#loginPop-->
</div>

<script type="text/javascript">
$("#loginForm").validate({
		rules: {
			email: {
				required: true,
				email: true
			},
			password: {
				required: true
			}
		},
		messages: {
			email: {
				required: "请输入登录邮箱地址",
				email: "请输入有效的邮箱地址，如：vivi@lagou.com"
			},
			password: {
				required: "请输入密码"
			}
		},
		submitHandler: function(form) {
			var email = $('#email').val();
			var password = $('#password').val();
			var remember = $('#remember').val();


			$(form).find(":submit").attr("disabled", true);
			
			jQuery.post("${rc.contextPath}/login", $("#loginForm").serialize(), function(data) {
				if(data.code == 200){
					location.reload();
				}
				$("#beError").css("display","block");
				$("#beError").text(data.info);
				
			}, 'json');
			
		}
	});
	</script>
